package com.qingke.oo;

public class Cylinder extends Circle{
	private double height = 1.0;
	
	public Cylinder(){
		
	}
	
	public Cylinder(double radius){
		this.setRadius(radius); 
	}
	
	public Cylinder(double radius,double height){
		this.setRadius(radius);
		this.height = height;
	}
	
	public Cylinder(double radius,double height,String color){
		this.setRadius(radius);
		this.height = height;
		this.setColor(color);
	}
	
	public void setHeight(double height){
		this.height = height;
	}
	
	public double getHeight(){
		return height;
	}
	
	public double getVolume(){
		return this.getArea()*height;
	}
	
	
	public static void main(String[]args){
		Cylinder c =new Cylinder();
		c.setColor("blue");
		c.setRadius(10);
		c.setHeight(20);
		System.out.println("area= "+c.getArea());
		System.out.println("volume= "+c.getVolume());
		System.out.println(c.toString());
	}
}
